Skip to content

test: support dual-server E2E integration tests and protocol negotiation fallbacks#413

Merged
anubhav756 merged 1 commit into
mcp-v202606from
anubhav-test-infra
Jul 22, 2026
Merged

test: support dual-server E2E integration tests and protocol negotiation fallbacks#413
anubhav756 merged 1 commit into
mcp-v202606from
anubhav-test-infra

Conversation

@anubhav756

@anubhav756 anubhav756 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR updates the E2E testing infrastructure to support running integration tests against multiple parallel server configurations, specifically:

  1. A standard Toolbox server (port 5000).
  2. A draft-enabled Toolbox server (port 5001) run with the --enable-draft-specs flag.

By verifying the SDK's behavior against both environments, we ensure robust fallback and negotiation behavior when newer protocol drafts are configured.

Note

This PR mirrors Python SDK changes from googleapis/mcp-toolbox-sdk-python#706.

Changes

1. E2E Test Infrastructure & Multi-Server Orchestration

  • Updated to start and monitor two separate instances of the Toolbox server process:
    • ToolboxServer1 on port 5000 (stable).
    • ToolboxServer2 on port 5001 (with --enable-draft-specs).
  • Introduced a helper killServer to gracefully terminate both server processes and clean up assets.
  • Added support for a second process reference.

2. E2E Test Suites

  • Refactored E2E tests in both @toolbox-sdk/core and @toolbox-sdk/adk to run all test cases against both servers (localhost:5000 and localhost:5001).
  • Added Protocol Configuration E2E Tests which:
    • Check that the client defaults to the correct protocol version if none is specified.
    • Verify that the client successfully negotiates and falls back to an older supported protocol (MCP_v20251125) if the target server does not support the client's configured draft protocol (MCP_DRAFT_2026_v1).

3. Protocol & Client Updates

  • Removed the verbose warning in ToolboxClient's constructor that alerted when initializing with a version other than MCP_LATEST.
    • This prevents spam when fallback / auto-negotiation takes place.
    • This PR adds dual-server support and other PRs added version negotiation.
      • With that ToolboxClient automatically negotiates or falls back to older/stable supported protocol versions when connecting to servers that don't support the latest draft spec.
      • Because of that, this trigger was warning even during the expected protocol negotiation or fallback.
      • Moreover, any protocol version included in getSupportedMcpVersions() is supported by the SDK.
      • If a user or internal transport explicitly targets a supported protocol version, it is valid behavior and shouldn't emit a warning.

Note

We will still handle the version migration guidance via documentation, deprecated annotations on obsolete versions, or a selective opt-in debug/telemetry logger rather than unconditional warning calls in constructor initialization.

5. Unit Test Adjustments

  • Equipped MockTransport in client/tool unit tests with a mock protocolVersion property to satisfy current transport interface requirements.
  • Removed obsolete assertions in unit tests checking for the deleted MCP_LATEST console warnings.

Note

This PR updates Protocol.MCP_LATEST to point to Protocol.MCP_DRAFT_2026_v1. This will be updated in the next PR down the chain (#394).

@anubhav756
anubhav756 requested a review from a team as a code owner July 17, 2026 15:57
@anubhav756
anubhav756 changed the base branch from anubhav-draft-negotiation to anubhav-sep-2243 July 17, 2026 16:02
@anubhav756
anubhav756 force-pushed the anubhav-test-infra branch from 4e4fd46 to 91f49d9 Compare July 17, 2026 16:14
@anubhav756 anubhav756 changed the title test: re-apply integration test dual-server support and parameterized test loops test: support dual-server E2E integration tests and protocol negotiation fallbacks Jul 17, 2026
@anubhav756
anubhav756 force-pushed the anubhav-test-infra branch 6 times, most recently from 618c662 to 3c0859f Compare July 17, 2026 23:03
@anubhav756 anubhav756 added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jul 18, 2026
@anubhav756
anubhav756 force-pushed the anubhav-test-infra branch 2 times, most recently from 5106002 to 8c56f1a Compare July 19, 2026 12:12
@twishabansal

Copy link
Copy Markdown
Contributor

Fixed GCS download paths by removing the v prefix from the version directory, resolving download failures during local test runs.

The GCS path seems to be the same. Have the binaries been moved? The tests seem to be passing

Comment thread packages/toolbox-core/src/toolbox_core/mcp/v20260618/mcp.ts
Comment thread packages/toolbox-core/src/toolbox_core/client.ts
@anubhav756

Copy link
Copy Markdown
Contributor Author

Fixed GCS download paths by removing the v prefix from the version directory, resolving download failures during local test runs.

The GCS path seems to be the same. Have the binaries been moved? The tests seem to be passing

Good catch! When I opened this PR, I had removed the v prefix because the dev build path didn't include it. However, post the stateless server release, the path requires the v prefix again. I've corrected the PR description.

@anubhav756
anubhav756 force-pushed the anubhav-test-infra branch from 8c56f1a to 1ef9d46 Compare July 21, 2026 05:35
@anubhav756
anubhav756 requested a review from twishabansal July 21, 2026 05:52
Base automatically changed from anubhav-sep-2243 to mcp-v202606 July 21, 2026 14:25
@anubhav756
anubhav756 force-pushed the anubhav-test-infra branch from 1ef9d46 to e94b464 Compare July 21, 2026 14:53
@anubhav756
anubhav756 merged commit cfaf031 into mcp-v202606 Jul 22, 2026
11 checks passed
@anubhav756
anubhav756 deleted the anubhav-test-infra branch July 22, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants